package com.woniuxy.rbac.web;

import com.woniuxy.rbac.entity.Member;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

@Controller
@RequestMapping("order")
public class OrderController {
    @RequestMapping("add")
    public String order(@RequestHeader("referer") String referer, HttpSession session) {
        //判断是否登录
      Member member = (Member) session.getAttribute("member");
     if (member == null) {
           return "redirect:/member/login?reback="+referer;
        }
        //继续增加数据到订单表
        return "redirect:/";
    }
}
